.TH std::initializer_list::begin 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::initializer_list::begin \- std::initializer_list::begin

.SH Synopsis
   const T* begin() const noexcept;            \fI(since C++11)\fP
                                               \fI(until C++14)\fP
   constexpr const T* begin() const noexcept;  \fI(since C++14)\fP

   Returns a pointer to the first element in the initializer list.

   If the initializer list is empty, the values of begin() and end() are unspecified,
   but will be identical.

.SH Parameters

   \fI(none)\fP

.SH Return value

   a pointer to the first element in the initializer list

.SH Complexity

   Constant

.SH Example


// Run this code

 #include <initializer_list>

 int main()
 {
     static constexpr auto il = {42, 24};
     static_assert(*il.begin() == 0x2A);
 }

.SH See also

   end returns a pointer to one past the last element
       \fI(public member function)\fP
